package com.zhentao.file.config;

import io.minio.MinioClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;

@EnableConfigurationProperties(MinioConfigerProperties.class)
public class MinioConfig {
    @Resource
    private MinioConfigerProperties minioConfigerProperties;
    @Bean
    public MinioClient buildMinioClient() {
        return MinioClient.builder().credentials(minioConfigerProperties.getAccessKey(), minioConfigerProperties.getSecretKey())
                .endpoint(minioConfigerProperties.getEndpoint()).build();
    }
}
